package com.zcs.thread.created;

/**
 * @author zcs
 * @since 2023/4/6
 */
public class MyThread {

    public static void main(String[] args) {
        //创建一个对象
        ThreadTest myThread1 = new ThreadTest();
        ThreadTest myThread2 = new ThreadTest();

        //调用start()方法
        myThread1.start();
        myThread2.start();
    }

    static class ThreadTest extends Thread {
        @Override
        public void run() {
            for (int i = 0; i < 20; i++) {
                System.out.println(getName() + " : " + i);
            }
        }
    }


}
